﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace Pap.Data
{
    /// <summary>
    /// 
    /// </summary>
    public interface ILookUpRepository : IRepository
    {
        /// <summary>
        /// Gets all.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> GetAll(string tableName);

        /// <summary>
        /// Deletes all.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="entities">The entities.</param>
        void DeleteAll(string tableName, IEnumerable<Guid> entities);

        /// <summary>
        /// Inserts the specified table name.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="name">The name.</param>
        void Insert(string tableName, string name);

        /// <summary>
        /// Inserts the specified table name.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="name">The name.</param>
        /// <param name="fkName">Name of the fk.</param>
        /// <param name="parentId">The parent id.</param>
        void Insert(string tableName, string name, string fkName, Guid parentId);

        /// <summary>
        /// Inserts the specified table name.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="name">The name.</param>
        /// <param name="extraParams">The extra params.</param>
        void Insert(string tableName, string name, Dictionary<string, string> extraParams);

        /// <summary>
        /// Updates the specified table name.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="id">The id.</param>
        /// <param name="name">The name.</param>
        void Update(string tableName, Guid id, string name);

        /// <summary>
        /// Updates the specified table name.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="id">The id.</param>
        /// <param name="name">The name.</param>
        /// <param name="fkName">Name of the fk.</param>
        /// <param name="parentId">The parent id.</param>
        void Update(string tableName, Guid id, string name, string fkName, Guid parentId);

        /// <summary>
        /// Gets the type of the previous trials close.
        /// </summary>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> GetPreviousTrialsCloseType();

        /// <summary>
        /// Gets the property.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="propName">Name of the prop.</param>
        /// <returns></returns>
        PropertyInfo GetProperty(ILookUpEntity entity, string propName);
    }
}
